<?php
/**
 * dashboard components.
 *
 * @package    TourAPI
 * @subpackage dashboard
 * @author     enkuso
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class dashboardComponents extends sfComponents
{
    public function executeSidebar()
    {
        $this->menu_items = sfConfig::get('app_menu_items');
        foreach($this->menu_items as $table => $params){
            $this->menu_items[$table]['count'] = Doctrine_Core::getTable($params['model'])
                ->createQuery('t')
                ->select('COUNT(t.id)')
                ->execute(array(),Doctrine::HYDRATE_SINGLE_SCALAR);
        }
    }
}
